/**
 * Created by Asura on 2015/11/30.
 */

var fs = require('fs'),
    data = '我喜欢nodejs';

fs.writeFile('testrw.txt', data, function (err) {
    if (!err) {
        console.log('成功写入');
    } else throw err;
});

fs.readFile('testrw.txt', 'utf8', function (err, data) {
    if (!err) {
        console.log(data);
    } else throw err;
});
